

<%@ page import="yby.JdbcUtils" %>
<%@ page import="yby.pojo.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String id = request.getParameter("id");
    User user = null;
    if (id != null){
        String sql = "SELECT `name`, `username` FROM `usertable` WHERE `id`=?";
        user = JdbcUtils.select(sql, User.class, id);
    }else {
        user = new User();
        user.setName("");
        user.setUsername("");
    }



%>

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java实训团队协作简单案例 - 用户信息编辑页面</title>
    <link rel="shortcut icon" href="assets/img/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="assets/vendors/font-awesome-4.7.0/css/font-awesome.min.css" />
    <link rel="stylesheet" href="assets/css/core.css" />
    <link rel="stylesheet" href="assets/css/index.css" />
    <link rel="stylesheet" href="assets/css/a.css"/>
    <link rel="stylesheet" href="assets/css/user.css" />
</head>

<body>
<header>
    <div class="header-logo">
        <a href="index.jsp"><img src="assets/img/favicon.png" /></a>
    </div>
    <div class="header-title">Java实训团队协作简单案例</div>
    <div class="header-people">
            <span class="header-people-name">
                <b>张三</b> <i class="fa fa-chevron-left"></i>
            </span>
        <div class="header-people-menu">
            <a href="resume.jsp">个人信息</a>
            <a href="login.jsp">注销</a>
        </div>
    </div>
</header>
<section class="container">
    <div class="main-left">
        <div class="main-left-menu">
            <a href="goods-list.jsp"><i class="fa fa-cubes"></i> 商品管理</a>
            <a href="user-list.jsp"><i class="fa fa-users"></i> 用户管理</a>
        </div>
    </div>
    <div class="main-right">
        <h3>用户信息编辑页面</h3>
        <form action="/user/del">
            <div>
                <label for="name">姓名：</label>
                <input name="n" type="text" id="name" value="<%=user.getName()%>"/>
            </div>
            <div>
                <label for="username">账号：</label>
                <input name="u" type="text" id="username" value="<%=user.getUsername()%>">
            </div>
            <div>
                <button type="submit" >提交</button>
            </div>
            <input type="hidden" name="i" value="<%=id%>">
        </form>
    </div>
</section>
</body>

</html>